Efficient loopless generation of Gray codes for k-ary trees

نویسندگان

  • Limin Xiang
  • Kazuo Ushijima
  • Changjie Tang
چکیده

Vajnovszki recently developed a loopless algorithm [Inform. Process. Lett. 68 (1998) 113] to enumerate Gray codes for binary trees, and then Korsh and Lafollette gave a loopless algorithm [Inform. Process. Lett. 70 (1999) 7] to generate Gray codes for k-ary trees. In this paper, another loopless algorithm is presented to list Gray codes for k-ary trees more efficiently in both space and time than the two former algorithms, and the algorithm is also conceptually simpler than the predecessors. Based on the algorithm, Gray codes for k-ary trees with n internal nodes (n> 2 and k > 3) can be generated in at least 22(n−1) different ways easily.  2000 Elsevier Science B.V. All rights reserved.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Loopless Algorithm to Generate Gray-codes of t-ary Trees Using RD-sequences∗

The right-distance sequences (or RDsequence for short) are concise representations of t-ary trees. A loopless algorithm is an algorithm that involves no recursion and uses only comparison statements and assignment statements to enumerate combinatorial objects. Hence, a loopless algorithm guarantees to run in a constant time for each generation of object. In this paper, we present a loopless alg...

متن کامل

Ranking and Loopless Generation of k-ary Dyck Words in Cool-lex Order

A binary string B of length n = kt is a k-ary Dyck word if it contains t copies of 1, and the number of 0s in every prefix of B is at most k−1 times the number of 1s. We provide two loopless algorithms for generating k-ary Dyck words in cool-lex order: (1) The first requires two index variables and assumes k is a constant; (2) The second requires t index variables and works for any k. We also e...

متن کامل

Parallel Generation of t-ary Trees

A parallel algorithm for generating t-ary tree sequences in reverse B-order is presented. The algorithm generates t-ary trees by 0-1 sequences, and each 0-1 sequences is generated in constant average time O(1). The algorithm is executed on a CREW SM SIMD model, and is adaptive and cost-optimal. Prior to the discussion of the parallel algorithm a new sequential generation with O(1) average time ...

متن کامل

The Gray-code Graph of t-ary Trees Using RD-sequences Is Hamiltonian∗

Usually, t-ary trees are encoded to integer sequences as their representation. It has been shown that the right-distance sequences (or RD-sequence for short) are concise representations of t-ary trees and are suitable for the usage of loopless Gray-code enumeration. For n, t 2, the RD-representation graph, denoted as RDt n, is a graph whose vertices are the RD-sequences of t-ary trees with n in...

متن کامل

Cool-lex order and k-ary Catalan structures

For any given k, the sequence of k-ary Catalan numbers, Ct,k = 1 kt+1 ( kt t ) , enumerates a number of combinatorial objects, including k-ary Dyck words of length n = kt and k-ary trees with t internal nodes. We show that these objects can be efficiently ordered using the same variation of lexicographic order known as cool-lex order. In particular, we provide loopless algorithms that generate ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Inf. Process. Lett.

دوره 70  شماره 

صفحات  -

تاریخ انتشار 1999